home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / Macintosh Programmer’s Workshop / MPW 3.1 / MPW / Interfaces / CIncludes / Packages.h < prev    next >
Text File  |  1990-12-13  |  7KB  |  237 lines

  1. /************************************************************
  2.  
  3. Created: Tuesday, September 12, 1989 at 7:10 PM
  4.     Packages.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.     Copyright Apple Computer, Inc.    1985-1989
  9.     All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __PACKAGES__
  15. #define __PACKAGES__
  16.  
  17. #ifndef __TYPES__
  18. #include <Types.h>
  19. #endif
  20.  
  21. #ifndef __DIALOGS__
  22. #include <Dialogs.h>
  23. #endif
  24.  
  25. #ifndef __FILES__
  26. #include <Files.h>
  27. #endif
  28.  
  29. #define listMgr 0                /*list manager*/
  30. #define dskInit 2                /*Disk Initializaton*/
  31. #define stdFile 3                /*Standard File*/
  32. #define flPoint 4                /*Floating-Point Arithmetic*/
  33. #define trFunc 5                /*Transcendental Functions*/
  34. #define intUtil 6                /*International Utilities*/
  35. #define bdConv 7                /*Binary/Decimal Conversion*/
  36. #define putDlgID -3999
  37. #define putSave 1
  38. #define putCancel 2
  39. #define putEject 5
  40. #define putDrive 6
  41. #define putName 7
  42. #define getDlgID -4000
  43. #define getOpen 1
  44. #define getCancel 3
  45. #define getEject 5
  46. #define getDrive 6
  47. #define getNmList 7
  48. #define getScroll 8
  49. #define currSymLead 16
  50. #define currNegSym 32
  51. #define currTrailingZ 64
  52. #define currLeadingZ 128
  53. #define zeroCycle 1             /*0:00 AM/PM format*/
  54. #define longDay 0                /*day of the month*/
  55. #define longWeek 1                /*day of the week*/
  56. #define longMonth 2             /*month of the year*/
  57. #define longYear 3                /*year*/
  58. #define supDay 1                /*suppress day of month*/
  59. #define supWeek 2                /*suppress day of week*/
  60. #define supMonth 4                /*suppress month*/
  61. #define supYear 8                /*suppress year*/
  62. #define dayLdingZ 32
  63. #define mntLdingZ 64
  64. #define century 128
  65. #define secLeadingZ 32
  66. #define minLeadingZ 64
  67. #define hrLeadingZ 128
  68.  
  69. /* Date Orders */
  70.  
  71. #define mdy 0
  72. #define dmy 1
  73. #define ymd 2
  74. #define myd 3
  75. #define dym 4
  76. #define ydm 5
  77.  
  78. /* Country Version */
  79.  
  80. #define verUS 0
  81. #define verFrance 1
  82. #define verBritain 2
  83. #define verGermany 3
  84. #define verItaly 4
  85. #define verNetherlands 5
  86. #define verBelgiumLux 6
  87. #define verSweden 7
  88. #define verSpain 8
  89. #define verDenmark 9
  90. #define verPortugal 10
  91. #define verFrCanada 11
  92. #define verNorway 12
  93. #define verIsrael 13
  94. #define verJapan 14
  95. #define verAustralia 15
  96. #define verArabia 16
  97. #define verFinland 17
  98. #define verFrSwiss 18
  99. #define verGrSwiss 19
  100. #define verGreece 20
  101. #define verIceland 21
  102. #define verMalta 22
  103. #define verCyprus 23
  104. #define verFarsi 48
  105. #define verCyrillic 49
  106. #define verFaroese 47
  107. #define verTurkey 24
  108. #define verYugoslavia 25
  109. #define verIreland 50
  110. #define verKorea 51
  111. #define verChina 52
  112. #define verTaiwan 53
  113. #define verThailand 54
  114. #define minCountry verUS
  115. #define maxCountry verThailand
  116.  
  117. enum {shortDate,longDate,abbrevDate};
  118. typedef unsigned char DateForm;
  119.  
  120. typedef OSType SFTypeList[4];
  121. typedef pascal short (*DlgHookProcPtr)(short item, DialogPtr theDialog);
  122. typedef pascal Boolean (*FileFilterProcPtr)(ParmBlkPtr paramBlock);
  123.  
  124. struct SFReply {
  125.     Boolean good;
  126.     Boolean copy;
  127.     OSType fType;
  128.     short vRefNum;
  129.     short version;
  130.     Str63 fName;
  131. };
  132.  
  133. typedef struct SFReply SFReply;
  134. struct Intl0Rec {
  135.     char decimalPt;             /*decimal point character*/
  136.     char thousSep;                /*thousands separator*/
  137.     char listSep;                /*list separator*/
  138.     char currSym1;                /*currency symbol*/
  139.     char currSym2;
  140.     char currSym3;
  141.     unsigned char currFmt;        /*currency format*/
  142.     unsigned char dateOrder;    /*order of short date elements*/
  143.     unsigned char shrtDateFmt;    /*short date format*/
  144.     char dateSep;                /*date separator*/
  145.     unsigned char timeCycle;    /*0 if 24-hour cycle, 255 if 12-hour*/
  146.     unsigned char timeFmt;        /*time format*/
  147.     char mornStr[4];            /*trailing string for first 12-hour cycle*/
  148.     char eveStr[4];             /*trailing string for last 12-hour cycle*/
  149.     char timeSep;                /*time separator*/
  150.     char time1Suff;             /*trailing string for 24-hour cycle*/
  151.     char time2Suff;
  152.     char time3Suff;
  153.     char time4Suff;
  154.     char time5Suff;
  155.     char time6Suff;
  156.     char time7Suff;
  157.     char time8Suff;
  158.     unsigned char metricSys;    /*255 if metric, 0 if not*/
  159.     short intl0Vers;            /*version information*/
  160. };
  161.  
  162. typedef struct Intl0Rec Intl0Rec;
  163. typedef Intl0Rec *Intl0Ptr, **Intl0Hndl;
  164.  
  165. struct Intl1Rec {
  166.     Str15 days[7];                /*day names*/
  167.     Str15 months[12];            /*month names*/
  168.     unsigned char suppressDay;    /*0 for day name, 255 for none*/
  169.     unsigned char lngDateFmt;    /*order of long date elements*/
  170.     unsigned char dayLeading0;    /*255 for leading 0 in day number*/
  171.     unsigned char abbrLen;        /*length for abbreviating names*/
  172.     char st0[4];                /*strings for long date format*/
  173.     char st1[4];
  174.     char st2[4];
  175.     char st3[4];
  176.     char st4[4];
  177.     short intl1Vers;            /*version information*/
  178.     short localRtn[1];            /*routine for localizing string comparison*/
  179. };
  180.  
  181. typedef struct Intl1Rec Intl1Rec;
  182. typedef Intl1Rec *Intl1Ptr, **Intl1Hndl;
  183.  
  184. #ifdef __cplusplus
  185. extern "C" {
  186. #endif
  187. pascal void InitPack(short packID)
  188.     = 0xA9E5;
  189. pascal void InitAllPacks(void)
  190.     = 0xA9E6;
  191. pascal Handle IUGetIntl(short theID);
  192. void sfpputfile(Point *where,char *prompt,char *origName,DlgHookProcPtr dlgHook,
  193.     SFReply *reply,short dlgID,ModalFilterProcPtr filterProc);
  194. void sfgetfile(Point *where,char *prompt,FileFilterProcPtr fileFilter,short numTypes,
  195.     SFTypeList typeList,DlgHookProcPtr dlgHook,SFReply *reply); 
  196. void sfpgetfile(Point *where,char *prompt,FileFilterProcPtr fileFilter,
  197.     short numTypes,SFTypeList typeList,DlgHookProcPtr dlgHook,SFReply *reply,
  198.     short dlgID,ModalFilterProcPtr filterProc); 
  199. pascal void IUSetIntl(short refNum,short theID,Handle intlParam);
  200. pascal void IUDateString(long dateTime,DateForm longFlag,Str255 result);
  201. void iudatestring(long dateTime,DateForm longFlag,char *result);
  202. void iudatepstring(long dateTime,DateForm longFlag,char *result,Handle intlParam);
  203. void iutimestring(long dateTime,Boolean wantSeconds,char *result);
  204. pascal void IUDatePString(long dateTime,DateForm longFlag,Str255 result,
  205.     Handle intlParam);
  206. void iutimepstring(long dateTime,Boolean wantSeconds,char *result,Handle intlParam);
  207. pascal Boolean IUMetric(void);
  208. pascal void IUTimePString(long dateTime,Boolean wantSeconds,Str255 result,
  209.     Handle intlParam);
  210. pascal short IUMagString(Ptr aPtr,Ptr bPtr,short aLen,short bLen);
  211. pascal void IUTimeString(long dateTime,Boolean wantSeconds,Str255 result);
  212. pascal short IUMagIDString(Ptr aPtr,Ptr bPtr,short aLen,short bLen);
  213. pascal short IUCompString(const Str255 aStr,const Str255 bStr); 
  214. short iucompstring(char *aStr,char *bStr);
  215. pascal short IUEqualString(const Str255 aStr,const Str255 bStr);
  216. short iuequalstring(char *aStr,char *bStr); 
  217. pascal void SFGetFile(Point where,const Str255 prompt,FileFilterProcPtr fileFilter,
  218.     short numTypes,SFTypeList typeList,DlgHookProcPtr dlgHook,SFReply *reply);
  219. pascal void StringToNum(const Str255 theString,long *theNum);
  220. void stringtonum(char *theString,long *theNum); 
  221. pascal void SFPGetFile(Point where,const Str255 prompt,FileFilterProcPtr fileFilter,
  222.     short numTypes,SFTypeList typeList,DlgHookProcPtr dlgHook,SFReply *reply,
  223.     short dlgID,ModalFilterProcPtr filterProc); 
  224. pascal void NumToString(long theNum,Str255 theString);
  225. void numtostring(long theNum,char *theString);
  226. pascal void SFPPutFile(Point where,const Str255 prompt,const Str255 origName,
  227.     DlgHookProcPtr dlgHook,SFReply *reply,short dlgID,ModalFilterProcPtr filterProc);
  228. pascal void SFPutFile(Point where,const Str255 prompt,const Str255 origName,
  229.     DlgHookProcPtr dlgHook,SFReply *reply); 
  230. void sfputfile(Point *where,char *prompt,char *origName,DlgHookProcPtr dlgHook,
  231.     SFReply *reply);
  232. #ifdef __cplusplus
  233. }
  234. #endif
  235.  
  236. #endif
  237.